package com.sen.patterns.structural.adapter.ex1;

/**
 * 打桩适配器
 * @author sen
 */
public class PegAdapter extends SquarePeg {
	private RoundPeg roundPeg;
	
	public PegAdapter(RoundPeg roundPeg) {
		this.roundPeg = roundPeg;
	}
	
	// 重写父类的方法，既能打方形桩，又能打圆形桩
	public void insert(String str) {
		super.insert(str);
		roundPeg.insertIntohole(str);
	}
}
